/*
 * ftp_client.h
 *
 *  Created on: 2011-4-8
 *      Author: kenping.liu
 */

#ifndef FTP_CLIENT_H_
#define FTP_CLIENT_H_

#include "mlive_inc.h"
#include "cmd_line.h"

namespace mlive
{

typedef struct _st_ftp_file_
{
    char    ip[MAX_NAME];
    int     port;
    char    user[MAX_NAME];
    char    passw[MAX_NAME];

    char    dir[MAX_NAME];
    char    file[MAX_NAME];
}FTP_FILE;

class FTP
{
public:
    static int parse_cmd(FTP_FILE* fdst, FTP_FILE* fsrc, CmdLineArgs& cmdargs);

    // ftp get file
    static int get(const FTP_FILE* fsrc, const char* locfile);

    // ftp upload/put file
    static int put(const FTP_FILE* fdst, const char* locfile);

    // ftp remove remote file
    static int rm(const FTP_FILE* fdst);

    // ftp mv remote file
};

}


#endif /* FTP_CLIENT_H_ */
